package cn.sany.cterminal.common.enumeration;

/**
 * 1：人工操作状态
 2：自动驾驶状态
 3：远程控制
 4：运维状态
 5：异常

 */
public enum ControlStateEnum {
    LOCAL(1, "人工操作状态"),
    AUTO(2, "自动驾驶状态"),
    REMOTE(3, "远程控制"),
    REPAIR(4, "运维状态"),
    EXCEPTION(5, "异常");

    /**
     * 状态编码
     **/
    private int code;

    /**
     * 状态信息
     **/
    private String msg;


    ControlStateEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
    public static String getMsgByCode(int code){
        for(ControlStateEnum responseEnum : ControlStateEnum.values()) {
            if(responseEnum.getCode() == code){
                return responseEnum.msg;
            }
        }
        return null;
    }
}
